package chaxun.txt;

import java.io.File;

public class Test {
    public static void main(String[] args) {
        File file = new File("G:/ideaIU");
        show(file);
    }
    public static void show(File file){
        File[] files = file.listFiles();
        for (File file1 : files) {
            if(files.length==0){
                break;
            }
            if(file1.getName().endsWith(".txt")){
                System.out.println(file1.getAbsolutePath());
            }
            if(file1.isDirectory()){
                show(file1);
            }
        }

    }

}
